package com.gx.smart.building.ui.common.model;

import android.net.Uri;

/**
 * @author xiaosy
 * @create 2020/5/12
 * @Describe
 **/
public class AttachmentInfo {
    private int type;//附件类型 1：图片 2：显示add image图片  3网络图片
    private Uri uri;// 本地图片地址
    private String fileName;//上传文件名称
    private boolean isFail = false;//文件上传失败
    private String url;//网络地址

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Uri getUri() {
        return uri;
    }

    public void setUri(Uri uri) {
        this.uri = uri;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean isFail() {
        return isFail;
    }

    public void setFail(boolean fail) {
        isFail = fail;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AttachmentInfo that = (AttachmentInfo) o;

        return type == that.type;
    }

    @Override
    public int hashCode() {
        return type;
    }

    public AttachmentInfo(int type, Uri uri, String fileName, boolean isFail, String url) {
        this.type = type;
        this.uri = uri;
        this.fileName = fileName;
        this.isFail = isFail;
        this.url = url;
    }

    public AttachmentInfo() {
    }
}
